import sys
import socket

ip = sys.argv[1]
port = int(sys.argv[2])
s = socket.socket()
s.bind((ip, port))
s.listen(3)

while True:
    client, addr = s.accept()
    print('client %s:%s connected' % addr)
    data = client.recv(1024)
    client.send(b'recv: ' + data)
    client.close()
